home *** CD-ROM | disk | FTP | other *** search
- Path: susx.ac.uk!taux5
- From: taux5@central.susx.ac.uk (Doan Nguyen)
- Newsgroups: comp.lang.c
- Subject: Invalid Indirection???
- Date: 13 Mar 1996 20:49:24 GMT
- Organization: University of Sussex
- Message-ID: <4i7cck$t67@infa.central.susx.ac.uk>
- NNTP-Posting-Host: solx1.central.susx.ac.uk
- X-Newsreader: TIN [version 1.2 PL2]
-
- I'm pretty new to C programming but I do know Modula-2 quite well and I
- was wondering if there was anyone out there who could tell me what
- the error "Invalid Indirection" means in C??
-
- I'm writing a program to map some Fourier data into it's r and theta
- components. I'm converting this function from it's Fortran equivalent
- and that's why I'm using arrays.
-
-
- void Map_RTheta ( float *data )
- {
-
- float tempa, tempb, tempi, tempj [NPIC-1];
- float xmap, ymap, rmap, Tmap [NPIC-1];
- float r, xi, yi, val, tmp;
- float pi, theta;
- int i, j;
- float *tempi_p;
- float *tempj_p;
- boolean test;
-
- tempi_p = &tempi;
- tempj_p = &tempj;
- pi = 3.14159265359;
-
- for (i=0;i<=NPIC-1; i+=2) { /* Copies Fourier Data into */
- *(data + i) = *(tempi_p + i); /* tempi and tempj array */
- }
-
- for (j=1; j<=NPIC-1; j+=2) {
- *(data + j) = *(tempj_p +(j-1));
- }
-
- for (j=0;j<=NPIC-1; j+=2) {
- theta = pi*(int)j / (NPIC-1);
- for (i=0;i<=NPIC-1; i++) {
- r = (int)i / sqrt(2.0);
- xi = r*sin(theta);
- yi = -(r)*cos(theta);
- val = xi+NHP;
- tmp = (tempi[i]*tempj[i])+(tempi[i+1]*tempj[i+1]));
-
- /* This is where the compiler stops and says there's an invalid
- indirection for the "tmp" assignment */
-
- }
- }
-
- }
-
-
- Any help for where I'm going wrong would be much appreciated.
- NPIC and NHP are constants defined in another section of the program.
-
-
-
-